<template>
    <view class='back'>        
            <!-- mode="region" 地区选择器 -->
            <picker mode="region" @change="positionChange">
                <view class="text">{{ region }} </view>
            </picker>
    </view>
    
</template>

<script setup>
	// const position_text = ref('请选择地区')
	// function positionChange(e){
		
	// }
    //地区选择器
	import { ref, defineEmits } from "vue"
	const emit = defineEmits(['update-region'])
	const region = ref("请选择地区")
	const province = ref("")
	const city = ref("")
	const district = ref("")
	function positionChange(e){
		console.log("ee", e)
		province.value = e.detail.value[0]
		city.value = e.detail.value[1]
		district.value = e.detail.value[2]
		console.log(province.value, city.value, district.value)
		region.value =province.value + '-' + city.value + '-' + district.value
		emit('update-region', e.detail.value);
	}
    
     
    
</script>

<style lang="scss" scoped> 
.back{
	background: white;
	// font-size: 36rpx;
}

</style>
